package states {
	import org.flixel.FlxSprite;
	import ui.SelectionMenu;
	import org.flixel.FlxText;
	import org.flixel.FlxG;
	import org.flixel.FlxState;
	/**
	 * @author NilsIH
	 */
	public class EndState extends FlxState{
		[Embed(source="../img/end.png")]
		private var End : Class;
		private var _menu:SelectionMenu;
		
		override public function create():void
		{
			super.create();	
			var sprite:FlxSprite = new FlxSprite(0, 0, End);
			add(sprite);
			
			var t:FlxText;
			t = new FlxText(0,20,FlxG.width,"Congratulations!\nYou have upgraded the hospital.\nTotal score: " + GamePlayState.score);
			t.size = 30;
			t.alignment = "center";
			add(t);
			
			_menu = new SelectionMenu(10);
			
			t = new FlxText(0, FlxG.height - 60, FlxG.width, "Press Space To Go Back");
			t.size = 16;
			t.alignment = "center";
			
			_menu.addTextOption(t, 0xFFFF9933, newGame);
			
			add(_menu);
		}
		
		public function newGame():void
		{
			FlxG.switchState(new MenuState());
			FlxG.play(AssetStore.infect);
		}
	}
}
